<script>
	import api from './api/index'
	export default {
		onLaunch: function() {
			console.log('App Launch')
			uni.login({
			  provider: 'weixin',
			  success: function (res) {
				  console.log(res.code)
				  api.common.login({code:res.code,userInfo:{}}).then(ret=>{
					  console.log(ret)
					  console.log('登录成功')
					  uni.setStorageSync('token',ret.data.token)
					  uni.setStorageSync('userinfo',ret.data)
				  })
			
			  },
			  fail(){
				  console.log('失败')
			  }
			});
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	@import url("./static/css/common.css");
page {
background: #F7F8F9;
color: #333;
}
	uni-swiper .uni-swiper-dot {
		width: 14rpx;
		height: 8rpx;
		border-radius: 4rpx;
	}
	uni-swiper .uni-swiper-dot-active {
		width: 30rpx;
		height: 8rpx;
		border-radius: 6rpx;
	}
	/*每个页面公共css */
</style>
